<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <c:url var="base" value="/"/>
    <base href="${base}">
    <meta charset="UTF-8">
    <title>新闻公告</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        a{
            text-decoration: none;
        }
        ul,li{
            list-style: none;
            padding: 10px 0;
        }
        h2{
            text-align: center;
        }
        .clear{
            clear: both;
        }
        .area{
            background: rgba(229, 239, 255, 0.9);
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
        }
        .main{
            width: 60%;
            margin-left: 20%;
        }
        .blank{
            height: 30px;
        }
        p{
            font-size: 20px;
        }
        .right{
            float: right;
            color: #596d75;
        }
        .btn {
            display: inline-block;
            background-color: #12a4ff;
            color: white;
            padding: 5px 15px;
            text-decoration: none;
            border-radius: 5px;
        }
        .btn:hover{
            background-color: #617581;
        }
        .update{
            background-color: #2323f5;
        }
    </style>
</head>
<body>
<div class="container">
    <div>
        <%@include file="/WEB-INF/jsp/nav.jsp" %>
    </div>
    <div>
        <%@include file="/WEB-INF/jsp/logbutton.jsp" %>
    </div>
    <div class="blank"></div>
    <div class="main">
        <div class="clear area">
            <div class="clear"><a class="btn" href="newslist">返回列表</a></div>
        <c:forEach items="${items2}" var="w">
            <h2 >${w.name}</h2>
            <% User manager=(User)session.getAttribute("user"); if(manager!=null){%>
            <a class="btn update" href="newsupdate?uid=${w.id}&op=update">修改此公告</a><span style="opacity: 0.5">(仅管理员可见)</span>
            <%} %>
            <div class="right">${w.date}</div>
            <div class="blank"></div>
            <div style="letter-spacing: 2px">${w.content}</div>
        </c:forEach>
        </div>
    </div>
    <div>
        <%@include file="/WEB-INF/jsp/footer.jsp" %>
    </div>
</div>
</body>
</html>